%% Author: zhangjun
%% Created: 2008-12-12
%% Description: TODO: Add description to servertest
-module(servertest).

%%
%% Include files
%%

%%
%% Exported Functions
%%
-export([stop/0, start/0]).

%%
%% API Functions
%%

%%
%% TODO: Add description of stop/function_arity
%%

loop() ->
    receive 
		gameover ->
            io:format("gameover!~n"),
            gameover
    after 5000 ->
    	io:format("i am running!~n"),
        loop()
    end.	
        
stop() -> %need called by another node
	kvs ! gameover,
	ok.
%%
%% TODO: Add description of start/function_arity
%%
start() -> 
    register(kvs,spawn(fun() -> loop() end)),
	ok.


%%
%% Local Functions
%%

